home *** CD-ROM | disk | FTP | other *** search
- public class DisciplineMesmerize extends Discipline {
- private static final String DISCIPLINE_NAME = "Mesmerize";
-
- public int cast(int level, int casterGuid, int targetGuid) {
- if (!((Discipline)this).CheckCastParameters(level, casterGuid, "Mesmerize")) {
- return 0;
- } else if (!((Discipline)this).CheckCastTarget(targetGuid, "Mesmerize")) {
- return 0;
- } else {
- ((Discipline)this).SetupWorld("Mesmerize");
- if (((Discipline)this).Fizzled(level)) {
- ((Discipline)this).DisplayFizzle("Mesmerize", level);
- return 0;
- } else {
- try {
- ((Discipline)this).DisplayCast("Mesmerize", level);
- float clanFactor = 1.0F;
- if (super.targetThing.GetActorClanId() == 12) {
- clanFactor = 0.5F;
- }
-
- if (super.targetThing.GetActorClanId() == 9) {
- clanFactor = 0.5F;
- }
-
- if ((super.targetThing.AIGetMindFlags() & 4) == 0 && super.targetThing.GetActorStat(9) >= super.casterThing.GetActorStat(9) && Math.random() * (double)super.targetThing.GetActorStat(5) * (double)clanFactor < Math.random() * (double)super.casterThing.GetActorStat(12)) {
- int effectGuid = super.targetThing.FindActorEffect("ef_disc_mesmerize");
- if (effectGuid != 0) {
- super.targetThing.RemoveActorEffect(effectGuid);
- }
-
- super.targetThing.AddActorEffectByLevel("ef_disc_mesmerize", Discipline.MESMERIZE_DURATIONS[level], level, casterGuid, 4);
- } else {
- ((Discipline)this).DisplayResist("Mesmerize", level);
- }
-
- return 1;
- } catch (Exception var7) {
- CodexConsole.PrintException(((Throwable)var7).getMessage() + " in " + "Mesmerize" + " [cast]");
- return 0;
- } catch (Error var8) {
- CodexConsole.PrintError(((Throwable)var8).getMessage() + " in " + "Mesmerize" + " [cast]");
- return 0;
- }
- }
- }
- }
- }
-